//
//  SelectCabinSheet.m
//  lv678
//
//  Created by apple on 15/8/25.
//  Copyright (c) 2015年 lampshade. All rights reserved.
//

#import "SelectCabinSheet.h"
@interface SelectCabinSheet()
@property (weak, nonatomic) IBOutlet UIButton *cancelBtn;
@property (weak, nonatomic) IBOutlet UIButton *okBtn;
@property (weak, nonatomic) IBOutlet UIPickerView *cabinsPicker;

@end
@implementation SelectCabinSheet
@synthesize cancelBtn,okBtn,cabinsPicker;


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
    cabinsPicker.delegate = self;
    cabinsPicker.dataSource = self;
    
    [cancelBtn addTarget:self action:@selector(disableSelectForCancel) forControlEvents:UIControlEventTouchUpInside];
    [okBtn addTarget:self action:@selector(disableSelectForOk) forControlEvents:UIControlEventTouchUpInside];
    cabinsArry = @[@"头等舱",@"公务舱",@"经济舱",@"其他舱"];
    
}

- (void)disableSelectForCancel{
    
    [self removeFromSuperview];
}

- (void)disableSelectForOk{
    
}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return cabinsArry.count;
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
        return [cabinsArry objectAtIndex:row];
}
@end
